<template>
        <!-- 面包屑导航区域 -->
        <el-breadcrumb>
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>用户管理</el-breadcrumb-item>
            <el-breadcrumb-item>用户详情</el-breadcrumb-item>
        </el-breadcrumb>

        <el-cord>
            <el-row :gutter="10">
                <el-col :span="7">
                    <el-input placeholder="Please input" class="input-with-select" v-model="leader_id" clearable>
                        <template #append>
                            <el-button @click="selectList">搜索</el-button>
                        </template>
                    </el-input>
                </el-col>


                <!--
                    email: "2229174583@qq.com"
                    gender: "男"
                    head_img: "https://nit-portal.oss-cn-beijing.aliyuncs.com/headImg/2022/04/30/73e1b89ea89849e4809b9382cf0a2ab8.jpg"
                    id: "787774265364480"
                    introduction: "我是你爷爷"
                    nickname: "张三"
                    phone: "15703863876
                -->
            </el-row>
            <el-row v-if="rightObj !== ''">
                <el-col :key="o" :span="14">
                    <el-card :body-style="{ padding: '0px' }">
                        <div v-if="!show">
                            <h3>请输入需要查询的用户id</h3>
                        </div>
                        <div style="padding: 14px" v-if="show">
                            <img
                                :src="rightObj.head_img"
                                class="image"
                            />
                            <h3>用户名：{{rightObj.nickname}}</h3>
                            <h3>性别：{{rightObj.gender}}</h3>
                            <h3>id：{{rightObj.id}}</h3>
                            <h3>个人介绍：{{rightObj.introduction}}</h3>
                            <h3>手机号：{{rightObj.phone}}</h3>
                            <h3>email：{{rightObj.email}}</h3>
                        </div>
                    </el-card>
                </el-col>
            </el-row>

        </el-cord>
</template>

<script>
import API from "@/network/team";

export default {
    data(){
        return {
            leader_id: '',
            rightObj: {},    //保存得到的分配权限
            show : false
        }
    },

    methods:{
        selectList(){            //搜索得到的列表
            API.SelectList(this.leader_id).then(res=>{
                console.log(res.data.code)
                if(res.data.code === 200){
                    this.$message.success("查询成功")
                    this.rightObj = res.data.data
                    this.show = true
                    console.log(this.rightObj)
                }else {
                    this.$message.error("查询失败")
               }
            })
        },
    },

}
</script>

<style>
.addUserButton{
    position: absolute;
    left: 10px;
}
.el-button{
    padding-left: 20px;
    padding-top: 10px;
}
.el-table{
    margin-top: 50px;
}

.bdTop{
    border-top: 1px solid #eee;
}
.bdBottom{
    border-bottom: 1px solid #eee;
}

.vcenter{
    display: flex;
    align-items: center;
}

.image {
    width: 50%;
    display: block;
}

h3{
    line-height: 15px;
    text-align: left;
    padding-left:10px ;
}

</style>
